<?php

declare(strict_types=1);

namespace app\index\controller;

use think\Request;
use app\BaseController;

use app\appcenter\lib\AppConfigService;

class Index extends BaseController
{
    public function index(Request $request)
    {

        $mod = $request->param('mod','index');
        $is_open = AppConfigService::get('snspc','is_open');
        if($is_open){
            $class = "app\\plugin\\snspc\\hook\\app\\hook"::class;
            if (method_exists($class,$mod)) {        
                return (new $class())->$mod($request);
            }
            
        }
        return view('index');
    }
    
}
